package com.sheeran.aichat.utils.rest;

import lombok.Getter;

/**
 * @author: sheeran
 * @create: 2025/02/10
 */
@Getter
public enum ResponseCode {

    // @formatter:off

    SUCCESS(200, "请求成功"),
    CUSTOM_MESSAGE(9999, ""),
    INTERNAL_SERVER_ERROR(-1, "未知错误"),
    COMMON_ERROR(1, "错误"),
    REQUEST_PARAMETER_NOT_VALID(400, "请求参数错误"),
    REQUEST_PARAMETER_MISS(402, "请求参数缺失"),
    UNAUTHORIZED(401, "登录超时，请重新登录"),
    FORBIDDEN(403, "没有权限"),
    WARNING(406, "警告"),
    INFO(407, ""),
    REMOTE_CALL_ERROR(510, "远程调用失败"),

    ;
    // @formatter:on

    /**
     * 返回码
     */
    private final int code;

    /**
     * 返回信息
     */
    private final String msg;

    ResponseCode(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
